Fix issue #26: run-qa-agent.sh and run-report-agent.sh don't build binary if missing#123
Fix issue #26: run-qa-agent.sh and run-report-agent.sh don't build binary if missing#123
Conversation
There was a problem hiding this comment.
Pull request overview
Updates agent runner scripts so they automatically build the shellforge binary when it’s not present, addressing issue #26.
Changes:
- Add a preflight check in
run-qa-agent.shto build./shellforgeif missing. - Add a preflight check in
run-report-agent.shto build./shellforgeif missing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| scripts/run-qa-agent.sh | Builds shellforge on-demand before running the qa command. |
| scripts/run-report-agent.sh | Builds shellforge on-demand before running the report command. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| set -euo pipefail | ||
| cd "$(dirname "$0")/.." | ||
|
|
||
| if [[ ! -f ./shellforge ]]; then |
There was a problem hiding this comment.
The existence check uses [[ ! -f ./shellforge ]], but the script later executes ./shellforge. If the file exists but isn’t executable (e.g., permissions changed), this will skip the build and then fail at exec. Consider checking -x (or ensuring executable via chmod +x) so the script reliably produces a runnable binary when needed.
| if [[ ! -f ./shellforge ]]; then | |
| if [[ ! -x ./shellforge ]]; then |
| if [[ ! -f ./shellforge ]]; then | ||
| echo "[run-report-agent] Building shellforge..." | ||
| go build -o shellforge ./cmd/shellforge | ||
| fi | ||
|
|
||
| exec ./shellforge report "${1:-.}" |
There was a problem hiding this comment.
This build-and-run logic duplicates scripts/run-agent.sh (which already builds ./shellforge when missing). Consider delegating to run-agent.sh report ... to avoid the runners drifting (e.g., differing build flags or checks) as future changes happen.
| if [[ ! -f ./shellforge ]]; then | |
| echo "[run-report-agent] Building shellforge..." | |
| go build -o shellforge ./cmd/shellforge | |
| fi | |
| exec ./shellforge report "${1:-.}" | |
| exec ./scripts/run-agent.sh report "${1:-.}" |
| set -euo pipefail | ||
| cd "$(dirname "$0")/.." | ||
|
|
||
| if [[ ! -f ./shellforge ]]; then |
There was a problem hiding this comment.
The existence check uses [[ ! -f ./shellforge ]], but the script later executes ./shellforge. If the file exists but isn’t executable (e.g., permissions changed), this will skip the build and then fail at exec. Consider checking -x (or ensuring executable via chmod +x) so the script reliably produces a runnable binary when needed.
| if [[ ! -f ./shellforge ]]; then | |
| if [[ ! -x ./shellforge ]]; then |
| if [[ ! -f ./shellforge ]]; then | ||
| echo "[run-qa-agent] Building shellforge..." | ||
| go build -o shellforge ./cmd/shellforge | ||
| fi | ||
|
|
||
| exec ./shellforge qa "${1:-.}" |
There was a problem hiding this comment.
This build-and-run logic duplicates scripts/run-agent.sh (which already builds ./shellforge when missing). Consider delegating to run-agent.sh qa ... to avoid the runners drifting (e.g., differing build flags or checks) as future changes happen.
| if [[ ! -f ./shellforge ]]; then | |
| echo "[run-qa-agent] Building shellforge..." | |
| go build -o shellforge ./cmd/shellforge | |
| fi | |
| exec ./shellforge qa "${1:-.}" | |
| exec ./scripts/run-agent.sh qa "${1:-.}" |
Auto-generated by Cata via /evolve dispatch